home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-14 | 2.8 KB | 156 lines | [TEXT/MPS ] |
- * This™ by Dean Yu
- * Really personalise your System 7 Macintosh.
-
- INCLUDE 'ToolEqu.a'
- INCLUDE 'SysEqu.a'
- INCLUDE 'Traps.a'
-
- This PROC EXPORT
- IMPORT DrawStrPtch
- IMPORT ShowPatch
-
- move.l a0,-(sp)
- _DetachResource
-
- move.w #$13d,d0 ; Trap number for _MenuSelect
- _GetTrapAddress ,NEWTOOL
- lea DrawStrPtch,a1
- move.l a0,2(a1) ; Save old _MenuSelect routine
- move.l a1,a0
- move.w #$13d,d0
- _SetTrapAddress ,NEWTOOL
-
- move.w #$115,d0 ; Trap number for _ShowWindow
- _GetTrapAddress ,NEWTOOL
- lea ShowPatch,a1
- move.l a0,2(a1) ; Save old _ShowWindow routine
- move.l a1,a0
- move.w #$115,d0
- _SetTrapAddress ,NEWTOOL
-
- rts
- ENDPROC
-
- DrawStrPtch PROC EXPORT
- IMPORT makeString
- bra.s startPatch
- oldDrawStr ds.l 1
-
- startPatch lea FinderName,a0 ; Make sure we’re only active in the Finder
- lea CurApName,a1
-
- cmp.l (a0)+,(a1)+
- bne.s toOldDraw
- cmp.w (a0)+,(a1)+
- bne.s toOldDraw
-
- pea nameHolder
- jsr makeString
-
- stashReplac move.l menuList,a0
- move.l (a0),a0
- move.l 6(a0),-(sp)
- move.w #1,-(sp)
- pea replaceStr
- _SetItem
-
- toOldDraw move.l oldDrawStr,a0
- jmp (a0)
-
- STRING ASIS
- aboutString dc.b 'About this Macintosh®'
- replaceStr dc.b 60
- dc.b 'About '
- nameHolder dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- macString dc.b '’s Macintosh®…'
- ENDPROC
-
- ShowPatch PROC EXPORT
- IMPORT makeString
- bra.s startPatch
- oldShow ds.l 1
-
- startPatch lea FinderName,a0 ; Make sure we’re only active in the Finder
- lea CurApName,a1
-
- cmpi.b #$ff,(a0) ; Special case for startup time
- beq.s toOldShow
-
- cmp.l (a0)+,(a1)+
- bne.s toOldShow
- cmp.w (a0)+,(a1)+
- bne.s toOldShow
-
- move.l 4(sp),-(sp)
- pea windName
- _GetWTitle
-
- lea windName,a0
- lea aboutString,a1
- move.l #12,d0
- cmpLoop cmp.b (a0)+,(a1)+
- bne.s toOldShow
- dbra d0,cmpLoop
-
- pea nameHolder
- jsr makeString
-
- stashReplac move.l 4(sp),-(sp)
- pea replaceStr
- _setWTitle
-
- toOldShow move.l oldShow,a0
- jmp (a0)
- STRING PASCAL
- aboutString dc.b 'About this Macintosh®'
- STRING ASIS
- replaceStr dc.b 60
- dc.b 'About '
- nameHolder dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- dc.l 0
- macString dc.b '’s Macintosh®'
- windName ds.b 256
- ENDPROC
-
- makeString PROC EXPORT
- move.l #9,d0
- move.l 4(sp),a0
- clearName clr.l (a0)+
- dbra d0,clearName
-
- sub.w #4,sp
- move.l #'STR ',-(sp)
- move.w #-16096,-(sp)
- _GetResource
- move.l (sp),a0 ; Get the Chooser name
-
- move.l (a0),a0
- moveq.l #0,d0
- move.b (a0),d0
- add.w #1,a0
- move.l 8(sp),a1
- _BlockMove ; Copy the name into replacement string
-
- _ReleaseResource
- move.l (sp)+,a0
- add.w #4,sp
- jmp (a0)
- ENDPROC
- END